<?PHP
  class combobox extends Control{
    public $type       = "";
    public $fillSelect = "";
    public $onChange   = "";

    public function getCode(){
      $res =  "<select name=\"".$this->name."\" style=\"".$this->style."\"";
      if($this->onChange != ""){
        $res .= " onchange=\"".$this->onChange."\"";
      }
      $res .= ">";
      $items = $GLOBALS['db']->ReadRows($this->fillSelect);
      foreach($items as $item){
        $res .= "<option value=\"".htmlentities($item->value)."\"";
        if($this->value == $item->value){
          $res .= " selected=\"true\"";
        }
        $res .= ">".htmlentities($item->label)."</option>";
      }

      $res .= "</select>";
     return $res;
    }

  }
?>